const express = require('express');
const {getCaptchaService} = require("../service/captchaService");
const router = express.Router();

// 生成验证码
router.get('/', async function (req, res, next) {
    const captcha = await getCaptchaService()
    req.session.captcha = captcha.text
    res.setHeader('Content-Type', 'image/svg+xml')
    res.send(captcha.data)
})

module.exports = router;
